Skip to content

Preserve empty directories in mcli mirror - #83

Merged
Vonng merged 2 commits into
mainfrom
codex/mirror-empty-directories
Nov 25, 2026
Merged

Vonng merged 2 commits into
mainfrom
codex/mirror-empty-directories

Conversation

@Vonng

@Vonng Vonng commented Nov 25, 2026 •

Copy link
Copy Markdown
Member

Fixes #80. Integrates Chen Shi’s original commit from #81 and a signed-off maintainer follow-up. The initial mirror scan maps empty local directories to zero-byte keys ending in a slash. A zero-byte regular file keeps its original key.

The filesystem scan uses object-key order, follows symlinks to regular files, and propagates listing errors to the command’s exit status. With --remove, an existing local directory that will receive a child keeps its identity and permissions. Remote objects ending in a slash use the existing S3 transfer path so their payload and headers survive cross-alias copies.

Ordinary recursive listings and mcli diff keep their existing file-list behavior. The --watch help describes when the local scan includes empty directories.

Regression coverage exercises the CLI for unreadable directories, symlinks with --remove, target parent retention, and diff. The SILO functional suite covers an empty-directory round trip, zero-byte regular files, and cross-alias transfers of slash-ending keys with payload and metadata.

Validated on macOS arm64 with Go 1.27.4 and pgsty/silo@d66020003. The full SILO functional suite passed, including the new marker test. In a versioned bucket, mirroring the symlink fixture with --remove kept the original file version and its metadata. A local target parent kept its inode and mode while receiving its first child. The Windows amd64 test binary and Linux amd64 client cross-compiled. The SILO server built against the candidate, and the Console object-list tests passed with the candidate selected.

GitHub rejected a Go workflow dispatch for this repository with HTTP 422 (“Actions has been disabled for this repository”). The validation above was run locally. The bilingual command reference update is pgsty/silo.pgsty.com#62.

On the final commit, go test -race -count=1 ./..., go vet ./..., the repository lint configuration, make install, dependency floors, branding, credits and release-state checks all passed.

chenshi5012 and others added 2 commits November 19, 2026 03:48
Signed-off-by: Chen Shi <chenshi5012@163.com>
Signed-off-by: Feng Ruohang <rh@vonng.com>
@Vonng
Vonng merged commit e96a131 into main Nov 25, 2026
@Vonng
Vonng deleted the codex/mirror-empty-directories branch November 25, 2026 04:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

mirror drops empty directories with a local filesystem endpoint

2 participants